<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2019/12/11
  Time: 13:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<% String name=request.getParameter("name");
    String password=request.getParameter("password");
    if(name.equals("smith")&&password.equals("123")){
        session.setAttribute("name",name);
        session.setAttribute("password",password);
        request.getRequestDispatcher("getAttribute.jsp").forward(request,response);  //请求重转发
    }else{

        response.sendRedirect("index.jsp");
    }
  %>
</body>
</html>
